<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Module actuator</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="EDoc">
</head>
<body bgcolor="white">
<div class="navbar"><a name="#navbar_top"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div>
<hr>

<h1>Module actuator</h1>
<ul class="index"><li><a href="#description">Description</a></li><li><a href="#index">Function Index</a></li><li><a href="#functions">Function Details</a></li></ul>The Actuator Agent is the one doing all planning and communicating with the other Agents.


<h2><a name="description">Description</a></h2>The Actuator Agent is the one doing all planning and communicating with the other Agents.
<h2><a name="index">Function Index</a></h2>
<table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#actuator-6">actuator/6</a></td><td>The actuator function receives all the messages from the server and depending on the message calls a function or forwards the information to another agent.</td></tr>
<tr><td valign="top"><a href="#createHexIds-0">createHexIds/0</a></td><td>createHexIds returns an ordered list containing all hex ids.</td></tr>
<tr><td valign="top"><a href="#init-0">init/0</a></td><td>The init function spawns the actuator.</td></tr>
<tr><td valign="top"><a href="#nodeWithBestVal-2">nodeWithBestVal/2</a></td><td>nodeWithBestVal calls all nodes and receives their node value.</td></tr>
<tr><td valign="top"><a href="#planner-2">planner/2</a></td><td>The planner asks the other agents for possible actions to do this round,
  and weight all these actions against each other and picks the action/actions with
  the highest weight.</td></tr>
<tr><td valign="top"><a href="#putHouseAndRoad-2">putHouseAndRoad/2</a></td><td>putHouseAndRoad take care of the initial phase, choosing the best nodes and puts initial settlements and roads.</td></tr>
<tr><td valign="top"><a href="#sendBoardToNode-3">sendBoardToNode/3</a></td><td>sendBoardToNode sends the boardlayout to every node.</td></tr>
</table>

<h2><a name="functions">Function Details</a></h2>

<h3 class="function"><a name="actuator-6">actuator/6</a></h3>
<div class="spec">
<p><tt>actuator(IDs::AgentIds, Turn, Board::Boardlayout, GameState, IGS::InternalGamestate, FP::FirstPhaseCounter) -&gt; ok</tt></p>
</div><p>The actuator function receives all the messages from the server and depending on the message calls a function or forwards the information to another agent.</p>

<h3 class="function"><a name="createHexIds-0">createHexIds/0</a></h3>
<div class="spec">
<p><tt>createHexIds() -&gt; [NodeIds]</tt></p>
</div><p>createHexIds returns an ordered list containing all hex ids</p>

<h3 class="function"><a name="init-0">init/0</a></h3>
<div class="spec">
<p><tt>init() -&gt; Pid</tt></p>
</div><p>The init function spawns the actuator</p>

<h3 class="function"><a name="nodeWithBestVal-2">nodeWithBestVal/2</a></h3>
<div class="spec">
<p><tt>nodeWithBestVal(Pids, X2::{Id, Value}) -&gt; Id</tt></p>
</div><p>nodeWithBestVal calls all nodes and receives their node value. It compares the values and returns the id of the node with the highest value.</p>

<h3 class="function"><a name="planner-2">planner/2</a></h3>
<div class="spec">
<p><tt>planner(IDs::AgentIDs, Board::Boardlayout) -&gt; ok</tt></p>
</div><p>The planner asks the other agents for possible actions to do this round,
  and weight all these actions against each other and picks the action/actions with
  the highest weight. The planner is in it sequential but the other agents can work
  in parallel when calculating the different actions to take, thus speeding up the
  overall calculating time.</p>

<h3 class="function"><a name="putHouseAndRoad-2">putHouseAndRoad/2</a></h3>
<div class="spec">
<p><tt>putHouseAndRoad(IDs::AgentIDs, FP::FirstPhaseCounter) -&gt; ok</tt></p>
</div><p>putHouseAndRoad take care of the initial phase, choosing the best nodes and puts initial settlements and roads.</p>

<h3 class="function"><a name="sendBoardToNode-3">sendBoardToNode/3</a></h3>
<div class="spec">
<p><tt>sendBoardToNode(Pids, Board, Nodes) -&gt; any()</tt></p>
</div><p>sendBoardToNode sends the boardlayout to every node</p>
<hr>

<div class="navbar"><a name="#navbar_bottom"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div>
<p><i>Generated by EDoc, May 20 2011, 17:27:19.</i></p>
</body>
</html>
